package jp.melodroid.sample.tabSample;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TextView;

public class tabSample extends TabActivity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        Resources res = getResources();
        TabHost tabhost = getTabHost();
        TabHost.TabSpec spec;
        Intent intent;
        
        intent = new Intent(this, ArtistsActivity.class);
        spec = tabhost.newTabSpec("artists").setIndicator("Arrtists",
        			res.getDrawable(R.drawable.ic_tab_artists)).setContent(intent);
        tabhost.addTab(spec);
        
        intent = new Intent(this, AlbumsActivity.class);
        spec = tabhost.newTabSpec("albums").setIndicator("Arrtists"
        			).setContent(intent);
        tabhost.addTab(spec);
        
        intent = new Intent(this, SongsActivity.class);
        spec = tabhost.newTabSpec("songs").setIndicator("Songs", 
        		res.getDrawable(R.drawable.ic_tab_artists_white)).setContent(intent);
        tabhost.addTab(spec);
        
        TextView v = (TextView) findViewById(R.id.tabtest);
        v.setText("this is test View");
        
        spec = tabhost.newTabSpec("test").setIndicator("testView").setContent(v.getId());
        tabhost.addTab(spec);

        
        tabhost.setCurrentTab(1);
    }
}
